<template>
    <fieldset>
        <legend><h2>页面一</h2></legend>
<ul>
    <h3>学生列表</h3>
<!--    <p>{{stuarray}}</p>-->
    <li v-for="(v,i) in stuArray">
        <span>{{v.stuName}}</span>
        <span>{{v.score}}</span>
    </li>
</ul>
        <button @click="cilckone">涨价</button>
    </fieldset>
</template>

<script>
    import {mapActions, mapMutations, mapState} from "vuex";
    export default {
        name: "pageone",
        data:()=>{
            return{

            }
        },

        //辅助函数和计算属性混合使用
        computed:{
            stuarray(){
                return this.$store.state.cart.cart
            },
        //    vuex辅助函数
            ...mapState({
                getCart:"cart",
                count:"count"
            }),
            ...mapState("stuScore",{
                stuArray:"stuScore"
            })
        },
        methods:{
            ...mapMutations("cart",["goUP"]),
            ...mapMutations("stuScore",["Random"]),
            ...mapActions("stuScore",["luckStudent"]),
        //    除了以上辅助
            cilckone(){
                this.$store.commit("stuScore/Random")
            }
        }


    }
</script>

<style scoped>

</style>